package cn.sumpu.app.coolsk.biz;

import java.util.*;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import cn.sumpu.app.coolsk.domain.CardNum;
import cn.sumpu.app.coolsk.domain.Keep;
import cn.sumpu.app.coolsk.domain.Member;
import cn.sumpu.app.coolsk.domain.MemberDetail;
import cn.sumpu.app.coolsk.domain.MemberTicker;
import cn.sumpu.app.coolsk.exception.AppBusinessException;
import cn.sumpu.toolkit.common.page.PageModel;
import cn.sumpu.toolkit.weibo.AccessUser;



public interface MemberBiz {
	//注册
	public Member register(String emailPath,Member member)throws AppBusinessException;
	//登陆
	public String login(HttpServletRequest request,HttpServletResponse response)throws AppBusinessException;
	
	//昵称登录
	public Member getMemberByNick(String pwd, String nickname)throws AppBusinessException;
	//邮箱登录
	public Member getMemberByEmail(String pwd, String email)throws AppBusinessException;
	//手机登录
	public Member getMemberByPhone(String pwd, String phone)throws AppBusinessException;
    //更新会员
	public void update(Member member)throws AppBusinessException;
	//验证邮箱 [注册]
	public Member getMemberEmail(String email)throws AppBusinessException;
	//验证昵称 [注册]
	public Member getMemberNickName(String nickname)throws AppBusinessException;
	//验证手机 [注册]
	public Member getMemberPhone(String phone)throws AppBusinessException;
	//是否注册
	public Member IsRegister(String loginType,String loginPwd)throws AppBusinessException;
	
	//新浪微博登录
	public AccessUser sinaLogin(String oauthVerifier)throws AppBusinessException;
	
	//腾讯微博登录
	public AccessUser tencentLogin(String oauthVerifier)throws AppBusinessException;
	
	public String outLogin(AccessUser accessUser,HttpServletRequest request)throws AppBusinessException;
	
	public void registerOutUser(AccessUser accessUser,String member)throws AppBusinessException;
	
	public Member getMemberById(String member)throws AppBusinessException;
	//更新资料
	public void updateMemberDetail(MemberDetail memberDetail,Member member)throws AppBusinessException;
	//查询详细资料
	public MemberDetail getMemberDetailById(String memberId) throws AppBusinessException ;
	//收藏
	public void keep(Keep keep)throws AppBusinessException;
	//
	public Keep getKeep(Keep keep)throws AppBusinessException;
	//
	public PageModel getKeepListByMid( Integer page, Integer pagesize, String memberId)throws AppBusinessException;
	//
	public CardNum getCardNum(String cardNum)throws AppBusinessException;
	//我的积分
	public PageModel getPointListByMid( Integer page,Integer pagesize, String memberId)throws AppBusinessException;
	//
	/*public void instertDiscuss(Discuss discuss)throws AppBusinessException;*/
	//
	public PageModel getDisListByMid( Integer page,Integer pagesize, String memberId)throws AppBusinessException;
	
	public Boolean checkMemberLogin(HttpServletRequest request)throws AppBusinessException;
	//
	public void insterMemberTicker(MemberTicker memberTicker)throws AppBusinessException;
	//
	public void updateMemberTicker(MemberTicker memberTicker)throws AppBusinessException;
	//
	public List<MemberTicker> getTickerListById(String memberId)throws AppBusinessException;
	//
	public void deleteTicker(String id)throws AppBusinessException;
	
	/**
	 * author BruceZhang
	 * @param nickname		用户昵称
	 * @param startTime		注册时间段
	 * @param endTime
	 * @return	查询用户列表
	 * @throws AppBusinessException
	 */
	PageModel getMemberList(String nickname, String startTime, String endTime, Integer pageSize, Integer page)throws Exception;
	//查询用户列表总条数
	Integer getMemberListCount(String nickname, String startTime, String endTime)throws Exception;
	
	//
	public void deleteKeepByid(String id)throws AppBusinessException;
	
	//
	public void updateCardNum(CardNum cardNum)throws AppBusinessException;
	
}
